package cn.lg.soar.core.config;

import cn.lg.soar.core.manager.ITokenStateManager;
import cn.lg.soar.core.manager.LocalTokenStateManager;
import cn.lg.soar.core.propertie.security.AccessTokenProperties;
import cn.lg.soar.core.util.RunnerShowInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;

/**
 * @author luguoxiang
 * @date 2022/8/18
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@Configuration
public class TokenConfig {

    @Autowired
    private AccessTokenProperties accessTokenProperties;

    @Lazy
    @Bean
    public ITokenStateManager tokenStateManager() {
        return new LocalTokenStateManager(accessTokenProperties.getExpire());
    }

    static {
        RunnerShowInfo.showText("启动成功", 9999);
    }

}
